package com.neuedu.gateway.controller;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

/**
 * @author 金山
 * 项目：sca-all-in-one
 * site: https://blog.fulfill.com.cn
 * 描述
 * @data 2025/5/2914:05
 */
@RestController
public class PaymentController {


    /**
     * http://localhost:7001/pay
     *
     * @return
     */
    @RequestMapping("/pay")
    public String pay(@RequestHeader(value = "X-Request-red") String XRequestRed, HttpServletRequest request, String[] name) {


        System.out.println("XRequestRed = " + XRequestRed);
        String header = request.getHeader("X-Request-red");
        System.out.println("header = " + header);

        System.out.println("iterator name is: ");
        if (name != null) {
            Arrays.stream(name).forEach(System.out::println);
        }

        return "订单已支付";
    }


}
